package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.domain.*;
import cn.wolfcode.wolf2w.service.*;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/index")
public class BannerController {

    @Autowired
    private IBannerService bannerService;


    @GetMapping("/banners/travel")
    public Object queryTravelTop5(){
        List<Banner> list = bannerService.queryTravelTop5();
        return JsonResult.success(list);
    }


    @GetMapping("/banners/strategy")
    public Object queryStrategyTop5(){
        Banner banner = bannerService.queryStrategyTop1();
        return JsonResult.success(banner);
    }

}
